<template>
  <div>
      <div class="register_con">
		<div class="l_con fl">
			<a class="reg_logo"><img src="static/images/logo.png"></a>
			<div class="reg_slogan">足不出户  ·  新鲜每一天</div>
			<div class="reg_banner"></div>
		</div>

		<div class="r_con fr">
			<div class="reg_title clearfix">
				<h1>用户注册</h1>
				
			</div>
			<div class="reg_form clearfix">
				<form>
				<ul>
					<li>
						<label>用户名:</label>
						<input type="text" v-model="user_name" id="user_name">
						<span class="error_tip">提示信息</span>
					</li>					
					<li>
						<label>密码:</label>
						<input type="password" v-model="pwd" id="pwd">
						<span class="error_tip">提示信息</span>
					</li>
					<li>
						<label>确认密码:</label>
						<input type="password" v-model="cpwd" id="cpwd">
						<span class="error_tip">提示信息</span>
					</li>
					<li>
						<label>邮箱:</label>
						<input type="text" v-model="email" id="email">
						<span class="error_tip">提示信息</span>
					</li>
					<li class="agreement">
						<input type="checkbox"  id="allow" checked="checked">
						<label>同意<a href='#'>《好又多用户使用协议》</a></label>
						<span class="error_tip2">提示信息</span>
					</li>
					<li class="reg_sub">
						<input type="button" value="注 册" @click="register">
					</li>
				</ul>				
				</form>
			</div>

		</div>

	</div>

	<div class="footer no-mp">
		<div class="foot_link">
			<a href="#">关于我们</a>
			<span>|</span>
			<a href="#">联系我们</a>
			<span>|</span>
			<a href="#">招聘人才</a>
			<span>|</span>
			<a href="#">友情链接</a>		
		</div>
		<p>CopyRight © 2016 北京趣活信息技术有限公司 All Rights Reserved</p>
		<p>电话：010-51851888    京ICP备*******8号</p>
	</div>
  </div>
</template>

<script>
import axios from 'axios'
export default {
	data() {
		return {
			user_name:'',
			pwd:'',
			cpwd:'',
			email:'',
		}
	},
	methods: {
		register() {
			let fdata=new FormData()
			fdata.append('username',this.user_name)
			fdata.append('password1',this.pwd)
			fdata.append('password2',this.cpwd)
			fdata.append('email',this.email)
			axios({
				url:'http://127.0.0.1:8000/app01/register/',
				method:'post',
				data:fdata
			}).then(resp=>{
				console.log(resp.data)
			})
		}
	},
	created() {

	}
}
</script>

<style>

</style>